/*
____/\\\\\\\\\_____        __/\\\________/\\\_        __/\\\\\\\\\\\_
 __/\\\///////\\\___        _\/\\\_______\/\\\_        _\/////\\\///__
  _\/\\\_____\/\\\___        _\/\\\_______\/\\\_        _____\/\\\_____
   _\/\\\\\\\\\\\/____        _\/\\\_______\/\\\_        _____\/\\\_____
    _\/\\\//////\\\____        _\/\\\_______\/\\\_        _____\/\\\_____
     _\/\\\____\//\\\___        _\/\\\_______\/\\\_        _____\/\\\_____
      _\/\\\_____\//\\\__        _\//\\\______/\\\__        _____\/\\\_____
       _\/\\\______\//\\\_        __\///\\\\\\\\\/___        __/\\\\\\\\\\\_
        _\///________\///__        ____\/////////_____        _\///////////__
*/
#include "WHW_ROOT.h"

RUI_ROOT_STATUS_Typedef RUI_ROOT = { 0 };
/************************************************************万能分隔符**************************************************************
 * 	@author:			//小瑞
 *	@performance:	    //ROOT函数
 *	@parameter:		    //
 *	@time:				//23-04-13 17:38
 *	@ReadMe:			//
 ************************************************************万能分隔符**************************************************************/
void RUI_F_ROOT(void)
{
    RUI_F_ROOT_ALL_STATUS();
}
/************************************************************万能分隔符**************************************************************
 * 	@author:			//小瑞
 *	@performance:	    //电机离线检测
 *	@parameter:		    //
 *	@time:				//23-04-13 15:01
 *	@ReadMe:			//
 ************************************************************万能分隔符**************************************************************/
uint8_t RUI_F_MOTOR_STATUS(WHW_MOTOR_Typedef* MOTOR)
{
    MOTOR->DATA.ONLINE_JUDGE_TIME--;

    if (MOTOR->DATA.ONLINE_JUDGE_TIME < 5)
    {
        MOTOR->DATA.ONLINE_JUDGE_TIME = 0;
        return RUI_DF_OFFLINE;
    }
    else
    {
        return RUI_DF_ONLINE;
    }
}


/************************************************************万能分隔符**************************************************************
 * 	@author:			//小瑞
 *	@performance:	    //总的离线检测
 *	@parameter:		    //
 *	@time:				//23-03-29 19:34
 *	@ReadMe:			//
 *  @LastUpDataTime:    //2023-04-13 15:22    bestrui
 *  @UpData：           //电机检测封装成函数
 ************************************************************万能分隔符**************************************************************/
void RUI_F_ROOT_ALL_STATUS(void)
{
    //电机在线检测
	RUI_ROOT.MOTOR_Pitch_2006 = RUI_F_MOTOR_STATUS(&WHW_MOTOR_Pitch);
	RUI_ROOT.MOTOR_Roll_2006 = RUI_F_MOTOR_STATUS(&WHW_MOTOR_Roll);
}
